home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group92c.txt
/
000070_icon-group-sender _Wed Nov 4 21:38:57 1992.msg
< prev
next >
Wrap
Internet Message Format
|
1993-01-04
|
2KB
Received: by cheltenham.cs.arizona.edu; Tue, 10 Nov 1992 04:51:12 MST
Date: 4 Nov 92 21:38:57 GMT
From: access.usask.ca!sue!hercules.cs.uregina.ca!skagos@decwrl.dec.com (P. Takis Skagos)
Organization: University of Regina, SK, Canada
Subject: Re: Character manipulation
Message-Id: <1992Nov04.213857.23013@sue.cc.uregina.ca>
References: <1992Nov2.031951.18774@midway.uchicago.edu>, <1992Nov03.172737.619209@sue.cc.uregina.ca>, <1992Nov4.020047.3235@midway.uchicago.edu>
Sender: icon-group-request@cs.arizona.edu
To: icon-group@cs.arizona.edu
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
In article <1992Nov4.020047.3235@midway.uchicago.edu> goer@midway.uchicago.edu writes:
>skagos@hercules.cs.uregina.ca (P. Takis Skagos) writes:
>>Well ... my character manipulation problems concerned parsing out
>>lines and performing all sorts of substitutions and stuff (pre-processing
>>a file). It is do-able with all the line scanning features of Icon,
>>but it is a real drag. Oh well.
>
>Give us some examples!
I cannot give examples ... part of this is for a class assignment ... and
if I post the code I've written so far, others might copy it. UGH! Anyway,
what the problem concerns is parsing a Pascal program and removing any white
space that is not required (comments, spaces, tabs, etc.). Actually, the
only place in Pascal that spaces are required ar around key-words (BEGIN,
END, IF, WHILE, etc ...) and within quote-delimeters (ex: write('hi there') ).
I've written the program in about 31 lines of Icon ... by reading a line
in at a time and then using line indexing (ie: line[i:j]) to format it
the way I want it. However, this involves having to constantly check
previous and next characters in the line (around our current position
in the line). I just think that there must be an easier way to do this.
Anyway, to appease you code-freaks :-) I will post my code after the
assignment is handed in ... the 12'th or something like that, but for now,
I cannot post it .... Sorry.
P. Takis Skagos
(skagos@cs.uregina.ca)